
namespace FastFood.Business.Logic
{
	using System;
	using System.Collections.Generic;
	using EDOSwit.Entity;
	using FastFood.Business.Entities;
	using FastFood.DataAccess;

	/// <summary>
	/// Represents the Manager of LogServicio.
	/// </summary>
	[Serializable]
	public class LogServicioManager : Singleton<LogServicioManager>
	{
		#region Methods

        public IList<LogServicio> ListarBySearch(string descripcion, DateTime? fecha, int? idTipo, int? idEstado)
        {
            try
            {
                return LogServicioData.Instancia.ListarBySearch(descripcion, fecha, idTipo, idEstado);
            }
            catch (Exception) { throw; }

        }

        public int ContarLogServicioByEstado(int idEstado)
        {
            try
            {
                return LogServicioData.Instancia.ContarLogServicioByEstado(idEstado);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Selects all records from the LogServicio table.
        /// </summary>
        public IList<LogServicio> Listar()
        {
            try
            {
                return LogServicioData.Instancia.Listar();
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Selects a single record from the LogServicio table.
        /// </summary>
        public LogServicio Obtener(int idLog)
        {
            try
            {
                return LogServicioData.Instancia.Obtener(idLog);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Selects all records from the LogServicio table by a foreign key.
        /// </summary>
        public IList<LogServicio> ListarPorIdInsumo(short idInsumo, DateTime? fecha)
        {
            try
            {
                return LogServicioData.Instancia.ListarPorIdInsumo(idInsumo, fecha);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Selects all records from the LogServicio table by a foreign key.
        /// </summary>
        public IList<LogServicio> ListarPorIdLote(int idLote)
        {
            try
            {
                return LogServicioData.Instancia.ListarPorIdLote(idLote);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Saves a record to the LogServicio table.
        /// </summary>
        public int Agregar(LogServicio logServicio)
        {
            try
            {
                return LogServicioData.Instancia.Agregar(logServicio);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Updates a record in the LogServicio table.
        /// </summary>
        public bool Modificar(LogServicio logServicio)
        {
            try
            {
                return LogServicioData.Instancia.Modificar(logServicio);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Updates a record in the LogServicio table.
        /// </summary>
        public bool ModificarPorIdInsumo(short idInsumo, int estado)
        {
            try
            {
                return LogServicioData.Instancia.ModificarPorIdInsumo(idInsumo, estado);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Deletes a record from the LogServicio table by its primary key.
        /// </summary>
        public bool Eliminar(int idLog)
        {
            try
            {
                return LogServicioData.Instancia.Eliminar(idLog);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Deletes a record from the LogServicio table by a foreign key.
        /// </summary>
        public void EliminarPorIdInsumo(short idInsumo)
        {
            try
            {
                LogServicioData.Instancia.EliminarPorIdInsumo(idInsumo);
            }
            catch (Exception) { throw; }
        }

        /// <summary>
        /// Deletes a record from the LogServicio table by a foreign key.
        /// </summary>
        public void EliminarPorIdLote(int idLote, int? estado)
        {
            try
            {
                LogServicioData.Instancia.EliminarPorIdLote(idLote, estado);
            }
            catch (Exception) { throw; }
        }

		#endregion
	}
}
